package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 小题组.
 */
public class ItemGroup {
    /**
     * Instantiates a new Item group.
     */
    public ItemGroup() {
        this.itemGroupSerialNum = 0;
        this.questionTypeID = "";
        this.chapterIDs = new ArrayList<>();
        this.difficulties = new ArrayList<>();
        this.questionCategoryRelationIDs = new ArrayList<>();
        this.questionCategories = "";
        this.subjective = false;
        this.responseDuration = 0;
        this.repeatTimes = 0;
        this.repeatInterval = 0;
    }

    /**
     * 编号.
     */
    private Integer itemGroupSerialNum;
    /**
     * 题型.
     */
    private String questionTypeID;
    /**
     * 章节.
     */
    private List<String> chapterIDs;
    /**
     * The Question category relation i ds.
     */
    private List<String> questionCategoryRelationIDs;
    /**
     * 难度.
     */
    private List<Double> difficulties;
    /**
     * 试题应用类别（以/分隔的字符串）.
     */
    private String questionCategories;
    /**
     * 是否人工评阅.
     */
    private boolean subjective;
    /**
     * 答题时间.
     */
    private double responseDuration;
    /**
     * 重播次数.
     */
    private Integer repeatTimes;
    /**
     * 重播间隔.
     */
    private double repeatInterval;

    /**
     * Gets item group serial num.
     *
     * @return the item group serial num
     */
    public Integer getItemGroupSerialNum() {
        return itemGroupSerialNum;
    }

    /**
     * Sets item group serial num.
     *
     * @param itemGroupSerialNum the item group serial num
     */
    public void setItemGroupSerialNum(Integer itemGroupSerialNum) {
        this.itemGroupSerialNum = itemGroupSerialNum;
    }

    /**
     * Gets question type id.
     *
     * @return the question type id
     */
    public String getQuestionTypeID() {
        return questionTypeID;
    }

    /**
     * Sets question type id.
     *
     * @param questionTypeID the question type id
     */
    public void setQuestionTypeID(String questionTypeID) {
        this.questionTypeID = questionTypeID;
    }

    /**
     * Gets chapter i ds.
     *
     * @return the chapter i ds
     */
    public List<String> getChapterIDs() {
        if (chapterIDs == null) {
            chapterIDs = new ArrayList<>();
        }
        return chapterIDs;
    }

    /**
     * Gets question category relation i ds.
     *
     * @return the question category relation i ds
     */
    public List<String> getQuestionCategoryRelationIDs() {
        if (questionCategoryRelationIDs == null) {
            questionCategoryRelationIDs = new ArrayList<>();
        }
        return questionCategoryRelationIDs;
    }

    /**
     * Gets difficulties.
     *
     * @return the difficulties
     */
    public List<Double> getDifficulties() {
        if (difficulties == null) {
            difficulties = new ArrayList<>();
        }
        return difficulties;
    }

    /**
     * Gets question categories.
     *
     * @return the question categories
     */
    public String getQuestionCategories() {
        return questionCategories;
    }

    /**
     * Sets question categories.
     *
     * @param questionCategories the question categories
     */
    public void setQuestionCategories(String questionCategories) {
        this.questionCategories = questionCategories;
    }

    /**
     * Is subjective boolean.
     *
     * @return the boolean
     */
    public boolean isSubjective() {
        return subjective;
    }

    /**
     * Sets subjective.
     *
     * @param subjective the subjective
     */
    public void setSubjective(boolean subjective) {
        this.subjective = subjective;
    }

    /**
     * Gets response duration.
     *
     * @return the response duration
     */
    public double getResponseDuration() {
        return responseDuration;
    }

    /**
     * Sets response duration.
     *
     * @param responseDuration the response duration
     */
    public void setResponseDuration(double responseDuration) {
        this.responseDuration = responseDuration;
    }

    /**
     * Gets repeat times.
     *
     * @return the repeat times
     */
    public Integer getRepeatTimes() {
        return repeatTimes;
    }

    /**
     * Sets repeat times.
     *
     * @param repeatTimes the repeat times
     */
    public void setRepeatTimes(Integer repeatTimes) {
        this.repeatTimes = repeatTimes;
    }

    /**
     * Gets repeat interval.
     *
     * @return the repeat interval
     */
    public double getRepeatInterval() {
        return repeatInterval;
    }

    /**
     * Sets repeat interval.
     *
     * @param repeatInterval the repeat interval
     */
    public void setRepeatInterval(double repeatInterval) {
        this.repeatInterval = repeatInterval;
    }

    /**
     * copy item group.
     *
     * @return the item group
     */
    public ItemGroup copy() {
        ItemGroup copy = new ItemGroup();
        copy.itemGroupSerialNum = itemGroupSerialNum;
        copy.questionTypeID = questionTypeID;
        copy.questionCategories = questionCategories;
        copy.responseDuration = responseDuration;
        copy.repeatInterval = repeatInterval;
        copy.repeatTimes = repeatTimes;
        copy.subjective = subjective;

        for (String questionCategoryRelationID : questionCategoryRelationIDs) {
            copy.questionCategoryRelationIDs.add(questionCategoryRelationID);
        }

        for (String chapterId : chapterIDs) {
            copy.chapterIDs.add(chapterId);
        }

        for (Double difficulty : difficulties) {
            copy.difficulties.add(difficulty);
        }

        return copy;
    }
}
